//
//  WareCell.m
//  MyItem
//
//  Created by SoulWater on 15/12/29.
//  Copyright © 2015年 admin. All rights reserved.
//

#import "WareCell.h"

@implementation WareCell

- (void)awakeFromNib {
    // Initialization code
}

-(void)setWareModel:(detailWareModel *)wareModel
{
    if (_wareModel != wareModel)
    {
        _wareModel = wareModel;
        
        [self setNeedsLayout];
    }

}


-(void)layoutSubviews
{
    [super layoutSubviews];
    
    NSString *urlStr = self.wareModel.imageurl;
    NSString *newStr = [urlStr substringToIndex:urlStr.length-5];
    [_imgView sd_setImageWithURL:[NSURL URLWithString:newStr]];
    
    _wnameLabel.text = self.wareModel.wname;
    
    _adwordLabel.text = self.wareModel.adword;
    
    _authorLabel.text = self.wareModel.author;
    
    _priceLabel.text = [NSString stringWithFormat:@"￥%@",self.wareModel.jdPrice];
    _goodLabel.text = [NSString stringWithFormat:@"好评%@ %@人",self.wareModel.good,self.wareModel.totalCount];
    
}



- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
